package com.erp.quertz.emailQuertz;

import com.erp.erp_servers.Dictionary.imp.ImpDictionary2Service;
import com.erp.erp_servers.Email.Impl.EmailServiceImpl;
import com.erp.erp_servers.Ftp.imp.ImpFtpService;
import com.erp.quertz.SpringUtil;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * Spring 整合 Quartz 的  Hello World!
 * @author dufy
 * @date 2017.02.26
 * 定时下载邮件附件
 */
@Slf4j
public class EmailAuto implements Job  {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

       /* ImpCustomerService customerService = SpringUtil.getBean(ImpCustomerService.class);
        customerService.getCustomerAndUserAndSupplier();*/

       /* System.out.println("This is a first spring combine quartz !");
        System.out.println("Welcome to Spring_Quartz World!"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) );
//        System.out.println("Let's begin ! \n \n");*/
        try {
            EmailServiceImpl email= SpringUtil.getBean(EmailServiceImpl.class);
            email.checkAuto();
        }catch (Exception e){

        }
    }

}

